package it.milanoeasy.jdoBeans;

import java.io.Serializable;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import javax.jdo.Query;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
  
@PersistenceCapable(table="Client", detachable="true")
public class ClientBean implements Serializable {
	Long clientId;
	Date dataora;
	String ip;
	String useragent;
	//String email;
	Double latitudine;
	Double longitudine;
	 		
	public ClientBean(){
		setDataora(new Date());
	}
	
	
	public String toString(){
		String result="";result+="ClientId: "+getClientId();
		//result+=", email: "+getEmail();
		result+=", dataora: "+getDataora();
		result+=", ip: "+getIp();
		result+=", useragent: "+getUseragent();		
		return result;
	}
		
	
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)	
	public Long getClientId() {
		return clientId;
	}

	public void setClientId(Long clientId) {
		this.clientId = clientId;
	}

	@Persistent
	public Date getDataora() {
		return dataora;
	}

	public void setDataora(Date dataora) {
		this.dataora = dataora;
	}
/*
	@Persistent
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	*/
	@Persistent
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Persistent
	public String getUseragent() {
		return useragent;
	}

	public void setUseragent(String useragent) {
		this.useragent = useragent;
	}

	@Persistent
	public Double getLatitudine() {
		return latitudine;
	}

	public void setLatitudine(Double latitudine) {
		this.latitudine = latitudine;
	}

	@Persistent
	public Double getLongitudine() {
		return longitudine;
	}

	public void setLongitudine(Double longitudine) {
		this.longitudine = longitudine;
	}			
	
}
